Skip to content

Fix and tests for issue #10154 inconsistent behavior with invalid dates #10520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed

Conversation

vincentdavis
Copy link
Contributor

closes #10154

This addresses the original issue and another discovered with the test cases.
Please review the tests to be sure you agree with the assertions.

@jreback jreback added Bug Datetime Datetime data dtype labels Jul 6, 2015
@jreback jreback added this to the 0.17.0 milestone Jul 6, 2015
@@ -4461,6 +4461,23 @@ def test_second(self):
self.assertIsInstance(r2, Float64Index)
tm.assert_index_equal(r1, r2)

class TestDaysInMonth(tm.TestCase):
def test_day_not_in_month_coerce_true_NaT(self):
self.assertTrue(isnull(to_datetime('2015-02-29', coerce=True)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the issue number as a comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add a blank line in between functions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments and blank lines. Should I open new issues for these test cases that do not pass?

self.assertTrue(isnull(to_datetime('2015-02-29', format="%Y-%m-%d", coerce=True)))
self.assertTrue(isnull(to_datetime('2015-04-31', format="%Y-%m-%d", coerce=True)))

@jreback
Copy link
Contributor

jreback commented Jul 7, 2015

merged via 5a76b44

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

to_datetime, inconsistent behavior with invalid dates.
2 participants